import request from '@/utils/request'

// 查询防光设备列表
export function getLightProtectionDeviceList(query) {
  return request({
    url: '/lightprotection/device/manage',
    method: 'get',
    params: query
  })
}

// 查询防光设备运行日志
export function getLightProtectionDeviceLogs(query) {
  return request({
    url: '/lightprotection/transmitter/logs',
    method: 'get',
    params: query
  })
}

// 控制防光设备
export function controlLightProtectionDevice(data) {
  return request({
    url: '/lightprotection/device/control',
    method: 'post',
    data: data
  })
}

// 清空防光设备日志
export function clearLightProtectionDeviceLogs() {
  return request({
    url: '/lightprotection/device/logs/clear',
    method: 'delete'
  })
}

// 查询防光设备参数
export function getLightProtectionDeviceParams(deviceId) {
  return request({
    url: `/lightprotection/device/params/${deviceId}`,
    method: 'get'
  })
}

// 更新防光设备参数
export function updateLightProtectionDeviceParams(data) {
  return request({
    url: '/lightprotection/device/params',
    method: 'put',
    data: data
  })
}

// 获取防光设备状态
export function getLightProtectionDeviceStatus(deviceId) {
  return request({
    url: `/lightprotection/device/status/${deviceId}`,
    method: 'get'
  })
}

// 更新防光设备工作模式
export function updateLightProtectionDeviceWorkMode(data) {
  return request({
    url: '/lightprotection/device/workmode',
    method: 'put',
    data: data
  })
}